﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class SeriesFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As SeriesBE
        Dim tmpSeries As SeriesBE = New SeriesBE()
        Try
            With tmpSeries
                .al = convertDTFromDb.convertDateTime(dr.Item("al"))
                .AnioAprob = convertDTFromDb.ConvertDecimal(dr.Item("AnioAprob"))
                .certificado = convertDTFromDb.ConvertString(dr.Item("certificado"))
                .del = convertDTFromDb.convertDateTime(dr.Item("del"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Estatus = convertDTFromDb.ConvertShort(dr.Item("Estatus"))
                .FFinal = convertDTFromDb.ConvertLong(dr.Item("FFinal"))
                .FfinSat = convertDTFromDb.ConvertLong(dr.Item("FfinSat"))
                .FInicial = convertDTFromDb.ConvertLong(dr.Item("FInicial"))
                .FiniSat = convertDTFromDb.ConvertLong(dr.Item("FiniSat"))
                .FUtilizados = convertDTFromDb.ConvertLong(dr.Item("FUtilizados"))
                .FUtiSat = convertDTFromDb.ConvertLong(dr.Item("FUtiSat"))
                .Id = convertDTFromDb.convertInt32(dr.Item("Id"))
                .IdEmpresa = convertDTFromDb.convertInt32(dr.Item("IdEmpresa"))
                .IdSerie = convertDTFromDb.convertInt32(dr.Item("IdSerie"))
                .NoAprob = convertDTFromDb.ConvertString(dr.Item("NoAprob"))
                .NoCertificado = convertDTFromDb.ConvertString(dr.Item("NoCertificado"))
                .serial = convertDTFromDb.ConvertString(dr.Item("serial"))
                .Serie = convertDTFromDb.ConvertString(dr.Item("Serie"))
                .seriecertificado = convertDTFromDb.ConvertString(dr.Item("seriecertificado"))
                .TipoComp = convertDTFromDb.ConvertShort(dr.Item("TipoComp"))
            End With
            Return tmpSeries
        Catch ex As Exception
            Throw
        Finally
            tmpSeries = Nothing
        End Try
    End Function
End Class
